package IC.AST;

import java.util.ArrayList;
import java.util.List;

/**
 * A container class for methods and fields.
 * Used by the parser when parsing the method and field list of a class.
 * @author nimrod
 *
 */
public class FieldOrMethodList {
	private ArrayList<Field> fields = new ArrayList<Field>();
	private ArrayList<Method> methods = new ArrayList<Method>();
	
	/**
	 * Adds a list of fields.
	 * @param fields
	 * 			A list of fields to add.
	 */
	public void addFields(List<Field> fields) {
		this.fields.addAll(fields);
	}
	
	/**
	 * Adds a method.
	 * @param method
	 * 			Method to add.
	 */
	public void addMethod(Method method) {
		this.methods.add(method);
	}
	
	/**
	 * Returns the list of fields added.
	 * @return
	 * 		Returns the list of fields added.
	 */
	public ArrayList<Field> getFields() {
		return fields;
	}

	/**
	 * Returns the list of methods added.
	 * @return
	 * 		Returns the list of methods added.
	 */
	public ArrayList<Method> getMethods() {
		return methods;
	}
}
